/*
 * This class is test class for multiInstance class.
 * 
 * Progress:
 * 		1.try to add three same name member into set
 * 		2.sysout all member,we find that only add one member into set
 * 		3.try to add more then 10 member with different name into set
 * 		4.sysout all member,we find that only 10 member in the set
 * 
 * public:
 * 		public static void main(String[] args);
 *
 */
package client;

import java.util.Iterator;
import java.util.Set;

import singleton.Soccer;

public class MultiInstanceClient {
	public static void main(String[] args) {
		Set<Soccer> soccerSet = null;
		
		//firstly,try to add some soccer that have same name
		Soccer.addScoccer("kaka");
		Soccer.addScoccer("kaka");
		Soccer.addScoccer("kaka");
		
		//sysout the soccerSet's member
		soccerSet = Soccer.getSet();
		Iterator<Soccer> it = soccerSet.iterator();
		while(it.hasNext())
		{
			System.out.println(it.next().getName());
		}
		System.out.println("END");
		//we only add one soccer successfully
		
		//then we try to add soccer with different name(more then 10)
		Soccer.addScoccer("hehe");
		Soccer.addScoccer("haha");
		Soccer.addScoccer("hiahia");
		Soccer.addScoccer("lllll2");
		Soccer.addScoccer("lllll3");
		Soccer.addScoccer("lllll4");
		Soccer.addScoccer("lllll5");
		Soccer.addScoccer("lllll6");
		Soccer.addScoccer("lllll7");
		Soccer.addScoccer("lllll8");
		Soccer.addScoccer("lllll9");
		Soccer.addScoccer("lllll0");
		
		//sysout the soccerSet's member
		soccerSet = Soccer.getSet();
		Iterator<Soccer> it2 = soccerSet.iterator();
		while(it2.hasNext())
		{
			System.out.println(it2.next().getName());
		}
		System.out.println("END");
		//we find that only add 10 soccer into set 
	}
}
